package com.example.sawgger.controller;

import com.example.sawgger.pojo.Swagger;
import com.example.sawgger.pojo.User;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: yaozun
 * @Date: 2018/5/8 0008 09:09
 * @Description:
 */
@RestController
public class SawggerController {
    // 创建线程安全的Map
    static Map<Integer, User> users = Collections.synchronizedMap(new HashMap<Integer, User>());

    @ApiOperation(value = "查询详情" , notes = "查询详情测试")
    @RequestMapping("/sawgger/detail")
    public Swagger detail() {
        Swagger swagger = new Swagger();
        swagger.setId(33);
        swagger.setText("sdfsdf");
        return swagger;
    }

    @ApiOperation(value = "添加单个" , notes = "添加单个测试")
//    @ApiImplicitParam(name = "swagger", value = "swagger实体", required = true, paramType = "Swagger")
    @RequestMapping("/sawgger/add")
    public Swagger add(Swagger swagger2) {
        Swagger swagger = new Swagger();
        swagger.setId(swagger2.getId());
        swagger.setText(swagger2.getText());
        return swagger;
    }


}
